<template>
  <div class='home-page'>
    <Toptab :checkedNum="0"></Toptab>
    <homepage></homepage>
  </div>
</template>

<script>
import Toptab from '@/components/Toptab.vue'
import homepage from './components/home-page.vue'
// 调用刷新总分的接口
import { refreshSum } from '@/api/user'
import store from '@/store'
import popmessage from '@/components/library/message'
// import router from '@/router'
export default {
  name: 'home-page',
  components: {
    Toptab,
    homepage
  },
  data () {
    return {
      res: ''
    }
  },
  created () {
    refreshSum().then((res) => {
      // console.log()
      // console.log(res.data.message)
      if (res.data.message === 'no login') {
        store.commit('user/setUser', {})
        popmessage({ type: 'warn', str: '登录信息已过期，请重新登录' })
        // router.push('/login')
      }
    })
  }
}
</script>

<style scoped lang='less'>
.home-page{
  height: 1000px;
}
</style>
